<div fxFlexFill fxLayout="row" (window:resize)="onResize()">
  <aside class="turbine-data-aside">
    <!-- <app-turbine-tag-selector
      [hasTag]="true"
      [setTag]="'04'"
      [codeTags]="codeTags"

      (limitedTurbines)="onLimitedTurbines($event)"
      (limitedTags)="onLimitedTags($event)">
    </app-turbine-tag-selector> -->
    <app-device-tag-selector fxFlexFill [deviceCategories]="deviceCategories" [choiceDeviceCount]="deviceCountLimit"
                             [multipleFarm]="true" [includeTagSelector]="true"
                             [tagSet]="'04'" [selectTages]="codeTags"
                             [defaultChooseDeviceCount]="defaultChooseDeviceCount"
                             (selectedTagsChange)="selectedTagsChange($event)"
                             (selectedDevicesChange)="onSelectedDevicesChange($event)">
    </app-device-tag-selector>
  </aside>

  <section #main class="main">
    <div class="main-part" *ngFor="let items of turbTable;let i=index" #mainPart>
      <table cellspacing="0" cellpadding=0>
        <thead>
        <tr>
          <th *ngFor="let item of items?.th;let n=index" [title]="item" #th (click)="changeTableDesc(item,n)">
            <div style="position: relative;">
              <div style="display: inline-block">
                {{item}}
                <br>{{items.unit[n]}}
              </div>
              <div class="group-by">
                <div [ngClass]="{'active':orderFlag === n+'_desc'}" class="group-by-desc"></div>
                <div [ngClass]="{'active':orderFlag === n+'_asc'}" class="group-by-asc"></div>
              </div>
            </div>

          </th>
        </tr>
        </thead>
        <tbody>
        <tr *ngFor="let item of items?.rows;let n=index">
          <td *ngFor="let o of item?.colomns;let m=index" #td>
            {{(o.cell.data.value===undefined?o.cell.data:o.cell.data.value | number: '1.0-2')}}
            {{o?.cell?.data?.valueDesc}}
            <!-- {{o?.cell?.data?.valueDesc || (o.cell.data.value===undefined?o.cell.data:o.cell.data.value | number: '1.0-2')}} -->
          </td>
        </tr>
        </tbody>
      </table>
      <!-- <p-table [value]="items">
        <ng-template pTemplate="header">
          <tr>
            <th *ngFor="let item of items?.th;let n=index" [title]="item" #th>
              {{item}}
              <br>{{items.unit[n]}}
            </th>
          </tr>
        </ng-template>
        <ng-template pTemplate="body" let-data>
          <tr>
            <td *ngFor="let o of data?.colomns;let m=index" #td>
              {{o.cell.data.valueDesc || (o.cell.data.value===undefined?o.cell.data:o.cell.data.value | number: '1.0-2')}}
            </td>
          </tr>
        </ng-template>
      </p-table> -->
    </div>
  </section>
</div>
